const joi = require('@hapi/joi')

const title = joi.string().min(1).required()
const cate_id = joi.number().integer().min(1).allow('').required()
const content = joi.string().allow('').required()
const state = joi.string().valid('已发布', '草稿', '').required()
const pagenum = joi.number().greater(0).required()
const pagesize = joi.number().greater(0).required()
const id = joi.number().integer().min(1).required()
module.exports = {
  title_cate_id_content_state: {
    body: {
      title,
      cate_id,
      content,
      state
    }
  },
  editArt: {
    body: {
      title,
      cate_id,
      content,
      state,
      Id:id
    }
  },
  getAtrList: {
    query: {
      pagenum,
      pagesize,
      cate_id,
      state
    }
  },
  id: {
    params: {
      id
    }
  }
}
